#!/usr/bin/perl



#
package Foo;
use strict;

sub AUTOLOAD {
    my @tag = qw(pre table bold);
    for my $name (@tag) {
print $name."<----- \n";
        no strict 'refs';
        # *$name = sub { "<$name>@_</$name>\n" };
        *{__PACKAGE__.'::'.$name} = sub { "<$name>@_</$name>\n" };
    }

}

sub new{
    my $class = shift;

    my @colors = qw(red blue green yellow orange purple violet);
    for my $name (@colors) {
        no strict 'refs';
        *$name = sub { "<font color='$name'>@_</font>\n" };
    }

    bless{},$class;;   
}


#
package main;

use strict;

my $sub = sub{ print "zzzzzzz\n" };
$sub->();

print Foo::table('aabbccddee');
print Foo::table('aabbccddee');
print Foo::pre('aabbccddee');

my $foo = Foo->new();

print Foo::blue('hi !!');
print Foo->violet('hi !!');



